<?php
// 花瓣采集
class HuabanAction extends Action {
    var $PickRoot= "";
    function __construct(){
        $this->PickRoot=PICK_DIR.MODULE_NAME.DIRECTORY_SEPARATOR;
        if(!is_dir($this->PickRoot)){
            mkdir($this->PickRoot);
        }
    }
    public function index(){
        
        logCmd("No Class");
    }
    
    public function user(){
        
    }
    
    public function boards(){
        load("@.dom");  
        $Id = $_GET["id"];
        $url = "http://huaban.com/boards/".$Id."/?limit=100";
        $html=file_get_html($url);
        foreach ($html->find("#waterfall .pin") as $k=>$pin){
            logCmd($k);
//             logCmd($pin->attr);
            $img = $pin->find(".img img",0);
            $imgsrc= $img->attr['src'];
            $imgsrc=str_replace("_fw192","",$imgsrc);
            logCmd($imgsrc);
        }
    }
   
    
   
}